package com.linzelin.mapper;

import com.linzelin.po.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class UserMapperImpl implements UserMapper {

    private static UserMapper mapper;

    public UserMapperImpl(SqlSessionTemplate sqlSession) {
        mapper = sqlSession.getMapper(UserMapper.class);
    }

    @Override
    public List<User> selectUser() {
        //使用mapper容器获取连接
        //调用mybatis返回结果
        return mapper.selectUser();
    }

    @Override
    public User selectUserById(int id) {
        return mapper.selectUserById(id);
    }
}
